<?php
// +----------------------------------------------------------------------
// * Created by PhpStorm.
// +----------------------------------------------------------------------
// * Author: D H
// +----------------------------------------------------------------------
// * Date: 2017/9/8
// +----------------------------------------------------------------------
// * Time: 17:05
// +----------------------------------------------------------------------
namespace app\index\controller;
use app\api\logic\Show as Shows;
use think\Request;
use tool\Common;

class Show {
    protected $shows;
    public function __construct(Shows $shows)
    {
        $this->shows = $shows;
    }

    //首页列表
    public function index(){
        $package = $this->shows->index();
        Common::json($package);
    }

    //根据分类得到产品列表列表
    public function productCat(){
        $data = [
            'catID' => 14,
            'page' =>1
        ];
        //$data = request::instance()->post();
        $package = $this->shows->init($data)->productCat();
        Common::json($package);
    }

    //产品分类页---操作
    public function screeningProductByID(){
        $data = request::instance()->post();
        $package = $this->shows->init($data)->screeningProductByID();
        Common::json($package);
    }

    //产品详情页
    public function productDetail(){
        $data = request::instance()->post();
        $package = $this->shows->init($data)->productDetail();
        Common::json($package);
    }

}